import request from '@/config/axios'
import {BaseProductClassVO} from "@/api/business/baseproductclass";



export interface CustFollowVO {
  id: number
  custId: number
  stageCode: string
  contacts: string
  subject: string
  detail: string
  remark: string
  creator: string
  createTime: Date
}
// 产品信息 VO
export interface ProdInfoVO {
  id: number // id
  code: string // 产品编码
  classCode: string // 产品分类(关联表：busi_base_product_class)
  name: string // 产品名称
  nameEn: string // 英文名称
  nameLatin: string // 拉丁文名称
  specs: string // 产品规格
  shape: string // 产品形状
  exterior: string // 颜色外观
  store: string // 储存条件
  remark: string // 备注
}

export const CustFollowApi = {
  // 查询客户跟进记录分页
  getCustFollowPage: async (params: any) => {
    return await request.get({ 
      url: `/business/cust-follow/page`, 
      params 
    })
  },

  // 查询客户跟进记录详情
  getCustFollow: async (id: number) => {
    return await request.get({ 
      url: `/business/cust-follow/get?id=${id}` 
    })
  },

  // 新增客户跟进记录
  createCustFollow: async (data: CustFollowVO) => {
    return await request.post({ 
      url: `/business/cust-follow/create`, 
      data 
    })
  },

  // 修改客户跟进记录
  updateCustFollow: async (data: CustFollowVO) => {
    return await request.put({ 
      url: `/business/cust-follow/update`, 
      data 
    })
  },

  // 删除客户跟进记录
  deleteCustFollow: async (id: number) => {
    return await request.delete({ 
      url: `/business/cust-follow/delete?id=${id}` 
    })
  },

  // 导出客户跟进记录 Excel
  exportCustFollow: async (params: any) => {
    return await request.download({ 
      url: `/business/cust-follow/export-excel`, 
      params 
    })
  },
}

// 产品分类 API
export const BaseProductClassApi = {
  // 查询产品分类列表
  getBaseProductClassList: async (params) => {
    return await request.get({ url: `/business/base-product-class/list`, params })
  },

  // 查询产品分类详情
  getBaseProductClass: async (id: number) => {
    return await request.get({ url: `/business/base-product-class/get?id=` + id })
  },

  // 新增产品分类
  createBaseProductClass: async (data: BaseProductClassVO) => {
    return await request.post({ url: `/business/base-product-class/create`, data })
  },

  // 修改产品分类
  updateBaseProductClass: async (data: BaseProductClassVO) => {
    return await request.put({ url: `/business/base-product-class/update`, data })
  },

  // 删除产品分类
  deleteBaseProductClass: async (id: number) => {
    return await request.delete({ url: `/business/base-product-class/delete?id=` + id })
  },

  // 导出产品分类 Excel
  exportBaseProductClass: async (params) => {
    return await request.download({ url: `/business/base-product-class/export-excel`, params })
  },
}

// 产品信息 API
export const ProdInfoApi = {
  // 查询产品信息分页
  getProdInfoPage: async (params: any) => {
    return await request.get({ url: `/business/prod-info/page`, params })
  },

  // 查询产品信息详情
  getProdInfo: async (id: number) => {
    return await request.get({ url: `/business/prod-info/get?id=` + id })
  },

  // 新增产品信息
  createProdInfo: async (data: ProdInfoVO) => {
    return await request.post({ url: `/business/prod-info/create`, data })
  },

  // 修改产品信息
  updateProdInfo: async (data: ProdInfoVO) => {
    return await request.put({ url: `/business/prod-info/update`, data })
  },

  // 删除产品信息
  deleteProdInfo: async (id: number) => {
    return await request.delete({ url: `/business/prod-info/delete?id=` + id })
  },

  // 导出产品信息 Excel
  exportProdInfo: async (params) => {
    return await request.download({ url: `/business/prod-info/export-excel`, params })
  },
}
